package io.gitee.chearnee.fw.datasecurity.core.annotation.desensitization;

import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.*;

/**
 * 手机号脱敏
 *
 * @author cn
 * @version 1.0
 * @description
 * @date 11/9/2022 2:44 PM
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@SDGeneralField
public @interface SDNumField {
    /**
     * 前几位显示
     */
    @AliasFor(annotation = SDGeneralField.class)
    int firstShow() default 3;

    /**
     * 后几位显示
     */
    @AliasFor(annotation = SDGeneralField.class)
    int lastShow() default 4;

    /**
     * 掩码标识
     */
    @AliasFor(annotation = SDGeneralField.class)
    char mask() default '*';

    /**
     * 脱敏参照
     * 顺序脱敏
     */
    @AliasFor("value")
    String eg() default "";

    /**
     * 脱敏参照
     * 顺序脱敏
     */
    @AliasFor("eg")
    String value() default "";

}
